{#**
*
* 功能描述（食品详细页模板）
*
* @author suoya <jlusuoya@gmail.com>
* @version 1
*#}

{#include file="header.tpl" title="商品详细" menuIdx=1 headImg="cate"#}

<div class="block box" >
    <div id="ur_here">
        当前位置: <a href="index.php">首页</a> <code>/</code> 我要订购 <code>/</code> {#$goodsInfo['name']#} </div>
</div>
<div class="block clearfix">
    <div class="AreaR" style="width:996px;">
        <div id="goodsInfo" class="block clearfix">
            <div class="imgInfo">
                <img width="497" height="497" src="data/cake/cake_{#$goodsInfo['id']#}.jpg" alt="{#$goodsInfo['name']#}"/>
            </div>

            <div class="textInfo">
                <form action="javascript:addToCart({#$goodsInfo['id']#})" method="post" name="ECS_FORMBUY" id="ECS_FORMBUY" >
                    <div class="clearfix">
                        <p class="pd_title clearfix">{#$goodsInfo['name']#}</p>
                        <div class="pd_con clearfix">
                            {#foreach $goodsInfo['introduce'] as $cl #}
                                <p><span>&nbsp;&nbsp;&nbsp;&nbsp;{#$cl#}</span></p>
                            {#/foreach#}
                            {#if $change #}
                                <p style="font-size: 14px; font-weight:bold; color: red;">商品已经在{#$goodsInfo['updatetime']#}被更改，现在看到的是更新之后的内容</p>
                            {#/if#}
                            <a class="good_favorite" href="index.php?action=favorite.add&good_id={#$goodsInfo['id']#} target="_blank">加入收藏</a>
                        </div>
                    </div>
                    <div class="clearfix">
                        <ul>
                            <li class="user_order_title user_order_title_1"><span>选择商品属性</span></li>
                            <li class="clearfix" style="display:none">
                            <dd class="ddR">
                                <strong>商品重量：</strong>1磅              </dd>
                            </li>

                            <li class="clearfix padd loop">
                                {#foreach $prices as $k =>$item #}
                                    {#$cur_price=round($item['price']*$goodsInfo['discount'],2)#}
                                    <label for="spec_value_{#$item['size']#}">
                                        <input type="radio" name="spec_{#$goodsInfo['id']#}" value="{#$cur_price#}"
                                               id="spec_value_{#$item['size']#}" {#if $item['default'] == 1#}checked="checked" {#/if#}onclick="changePrice()" />
                                        {#$item['size']#}.0{#$item['unit']#}:{#$item['describe']#}
                                        [￥{#$cur_price#}元]                        </label>
                                    {#/foreach#}

                                <input type="hidden" name="spec_list" value="{#$goodsInfo['id']#}" />
                            </li>

                            <li class="clearfix" style="padding-top:5px;">
                                购买数量：        
                                <select onchange="changePrice()" id="number" name="number">
                                    <option value="1">1</option>
                                    <option value="2">2</option>
                                    <option value="3">3</option>
                                    <option value="4">4</option>
                                    <option value="5">5</option>
                                    <option value="6">6</option>
                                    <option value="7">7</option>
                                </select>
                            </li>
                            <li class="clearfix"  style=" background:none">
                            <dd class="ddL" style="border:none">
                                合计：<font id="ECS_GOODS_AMOUNT" class="shop" style="color:#F1592A; font-size:18px; font-family:'黑体'">￥0元</font>
                                {#if $goodsInfo['discount'] != 1#}{#round($goodsInfo['discount']*10,1)#}折促销{#/if#}
                            </dd>
                            <dd class="ddR" style="display:none">
                            </dd>
                            </li>      
                            <li class="padd" style="text-align:right; margin-top:-30px;margin-right:10px;">
                                <a href="javascript:addToCart({#$goodsInfo['id']#})"><img src="images/bnt_cart.gif" /></a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
        </div>
        <div class="box block clearfix">
            <div class="box_1" style="display:inline;">
                <div class="property_l">
                    <ul>
                        <li><span class="span_t">温馨提示：蛋糕规格及免费配送餐具:</span><br>
                            <span class="span_c">1.0磅:    1刀+5盘+5叉       适合4-5人<br />2.0磅:    1刀+10盘+10叉    适合7-8人<br />3.0磅:    1刀+15盘+15叉    适合11-12人<br />4.0磅:    1刀+15盘+15叉    适合11-12人<br />5.0磅:    1刀+25盘+25叉    适合18-20人<br />8.0磅:    1刀+25盘+25叉    适合18-20人</span></li>
                        <li><span class="span_t">口味:</span><br>
                            <span class="span_c">{#$goodsInfo2['taste']#}</span></li>
                        <li><span class="span_t">甜度:</span><br>
                            {#assign var="sweet" value=array("☆☆☆☆☆", "★☆☆☆☆", "★★☆☆☆", "★★★☆☆", "★★★★☆", "★★★★★")#}
                            <span class="span_c">{#$sweet[$goodsInfo2['sweetness']]#}</span></li>
                        <li><span class="span_t">适合人群:</span><br>
                            <span class="span_c">{#$goodsInfo2['suits']#}</span></li>
                        <li><span class="span_t">保鲜条件:</span><br>
                            <span class="span_c">{#$goodsInfo2['storage']#}</span></li>
                        <li><span class="span_t">适合节日:</span><br>
                            <span class="span_c">{#$goodsInfo2['holiday']#}</span></li>
                        <li><span class="span_t">原材料:</span><br>
                            <span class="span_c">{#$goodsInfo2['material']#}</span></li>
                    </ul>
                </div>
                <div class="property_r">
                    <table width="100%" cellpadding="0" cellspacing="0" >
                        <tr>
                            <td width="240">
                                <img width="250" height="405" src="data/cake/cake_{#$goodsInfo['id']#}_1.jpg" alt="{#$goodsInfo['name']#}"/>
                            </td>
                            <td>
                                <div class="nutrition_facts">
                                    <table width="100%" >
                                        <tr>
                                            <td align="left" colspan="2"><span class="title">营养成分</span></td>
                                        </tr>
                                        <tr>
                                            <td align="right" colspan="2">每 100克</td>
                                        </tr>							
                                        <tr>
                                            <td width="50%">能量</td>
                                            <td align="right">{#$goodsInfo2['attr1']#}千焦</td>
                                        </tr>
                                        <tr>
                                            <td>蛋白质</td>
                                            <td align="right">{#$goodsInfo2['attr2']#}克</td>
                                        </tr>	
                                        <tr>
                                            <td>脂肪</td>
                                            <td align="right">{#$goodsInfo2['attr3']#}克</td>
                                        </tr>
                                        <tr>
                                            <td>碳水化合物</td>
                                            <td align="right">{#$goodsInfo2['attr4']#}克</td>
                                        </tr>
                                        <tr>
                                            <td>钠</td>
                                            <td align="right">{#$goodsInfo2['attr5']#}毫克</td>
                                        </tr>

                                    </table>	
                                    <table width="100%" style="margin-top:80px;">
                                        <tr>
                                            <td align="left" colspan="2"><span class="title">Nutrition Facts</span></td>
                                        </tr>
                                        <tr>
                                            <td align="right" colspan="2">Per 100g</td>
                                        </tr>							
                                        <tr>
                                            <td width="50%">Energy</td>
                                            <td align="right">{#$goodsInfo2['attr1']#}KJ</td>
                                        </tr>
                                        <tr>
                                            <td>Protein</td>
                                            <td align="right">{#$goodsInfo2['attr2']#}g</td>
                                        </tr>	
                                        <tr>
                                            <td>Total Fat</td>
                                            <td align="right">{#$goodsInfo2['attr3']#}g</td>
                                        </tr>
                                        <tr>
                                            <td>Carbohydrate</td>
                                            <td align="right">{#$goodsInfo2['attr4']#}g</td>
                                        </tr>
                                        <tr>
                                            <td>Sodium</td>
                                            <td align="right">{#$goodsInfo2['attr5']#}mg</td>
                                        </tr>

                                    </table>
                                </div>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
        <div class="blank"></div>



    </div>
</div>
<div class="block clearfix">
    <script type="text/javascript" src="js/jscript_score.js"></script><div id="ECS_COMMENT"> <div class="box">
            <div class="box_1">
                <h3><span class="text">用户评论</span>(共<font class="f1">{#$totalCnt#}</font>条评论)</h3>
                <div class="boxCenterList clearfix" style="height:1%;">
                    <ul class="comments">
                        {#foreach $comments as $item #}
                            <li class="word" style="min-height:75px;_height:75px">
                                <div style="float:right;width:140px;">
                                    蛋糕口味：<img src="images/stars{#$item['taste']#}.gif" alt="蛋糕口味：" /><br />
                                    送货服务：<img src="images/stars{#$item['service']#}.gif" alt="送货服务" /><br />
                                    购买体验：<img src="images/stars{#$item['whole']#}.gif" alt="购买体验" /><br />
                                </div>
                                <div style="float:left;width:790px;">
                                    <font class="f2">{#$item['username']#}</font> <font class="f3">( {#$item['createtime']#} ) 规格：{#$item['size']#}</font>
                                    <p>{#$item['content']#}</p>
                                </div>
                            </li>
                        {#/foreach#}
                    </ul>
                    <div class="blank5"></div>
                </div>
                {#include file="paging_bar.tpl"#}
            </div>
        </div>
        <div class="blank5"></div>
    </div>
</div>
<script type="text/javascript">
    var goods_id = 3;
    var goodsattr_style = 1;
    var gmt_end_time = 0;
    var day = "天";
    var hour = "小时";
    var minute = "分钟";
    var second = "秒";
    var end = "结束";
    var goodsId = 3;
    var now_time = 1377747961;
    onload = function() {
        changePrice();
        fixpng();
        try {
            onload_leftTime();
        }
        catch (e) {
        }
    }
    /**
     * 点选可选属性或改变数量时修改商品价格的函数
     */
    function changePrice()
    {
        var attr = getSelectedAttributes(document.forms['ECS_FORMBUY']);
        var qty = document.forms['ECS_FORMBUY'].elements['number'].value;
        if (document.getElementById('ECS_GOODS_AMOUNT'))
        {
            var val = attr * qty;
            document.getElementById('ECS_GOODS_AMOUNT').innerHTML = "￥" + val.toFixed(2) + "元";
        }
    }
</script>

{#include file="footer.tpl"#}
